package mt.demo.web.comm;

import java.util.Objects;

/**
 * Created by watson on 2015/11/11.
 */
public class YomsException extends Exception {
    private int level = 3;
    private Objects tag;

    public int getLevel() {
        return level;
    }

    public Objects getTag() {
        return tag;
    }
    public void setTag(Object tag){
        this.tag= (Objects) tag;
    }

    public YomsException() {
    }

    public YomsException(String message) {
        super(message);
    }

    public YomsException(String message, Throwable cause) {
        super(message, cause);
    }

    public YomsException(Throwable cause) {
        super(cause);
    }

    public YomsException(String message, int level) {
        super(message);
        this.level = level;
    }

    public void setLevel(int level) {
        if (level <= 0) {
            this.level = 1;
        } else if (level > 3) {
            this.level = 3;
        } else {
            this.level = level;
        }
    }
}
